import settingConfig from '@/setting'
import { ActionTree, Module, MutationTree } from 'vuex'
import { RootState } from '../root-state'
export interface setting {
    fixedHeader?: boolean;
    sidebarLogo?: boolean;
}

const state: setting = {
    fixedHeader: settingConfig.fixedHeader,
    sidebarLogo: settingConfig.sidebarLogo
}
export const CHANGE_SETTING = 'CHANGE_SETTING'
const mutations: MutationTree<setting> = {
    [CHANGE_SETTING](state: setting, data: setting) {
        state = data
    }
}

const action: ActionTree<setting, RootState> = {
    [CHANGE_SETTING]({ commit }, data: setting) {
        commit(CHANGE_SETTING, data)
    }
}
export const setting: Module<setting, RootState> = {
    namespaced: true,
    state: state
}
